<?php

namespace app\model;

class LessonModel extends BaseModel
{
    protected  $table = 'course';


    /**
     * @param $page
     * @param $pageSize
     * @param array $condition
     * @param bool $is_count
     * @param string $order
     * @return false|int|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function getLessonListPage($page,$pageSize,$condition=[],$is_count = false,$order=''){
        $condition['delete_flag'] = self::DELETED;
        $join=[

        ];
        $this->alias('course')
            ->field('course.*')
            ->join($join);
        if($condition){
            $this->where($condition);
        }
        if($order){
            $this->order($order);
        }
        if($is_count){
            return $this->count();
        }
        return $this->page($page,$pageSize)->select();
    }
}